﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SchoolCardSystem
{
    public partial class schoolcarddb : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            MySqlConnection connection = new MySqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["connection"]
            .ConnectionString.ToString());
            try
            {
                connection.Open();
                this.Label1.Text = "连接数据库成功!";
            }
            catch (Exception err)
            {
                Label1.Text = "连接数据库失败！";
                Label1.Text += err.Message;
            }
            finally
            {
                connection.Close();
            }

        }
    }
}